<!--
 @description PC端主页配置
 @fileName webindex.vue
 @author zengqiongying
 @created 2022/12/06 15:38:31
-->
<template>
  <div class="qup-full-page">
    <edit
      v-if="showEdit"
      :page-show.sync="showEdit"
      :page-data="pageData"
      :detail="editData"
      @success="handleSubmitSuccess"
    />
    <FloorList v-show="!showEdit" ref="refFloor" :page-data="pageData" editable @edit="handleEdit" />
  </div>
</template>

<script>
import Edit from '@/components/FloorConfig/Edit'
import FloorList from '@/components/FloorConfig/index'
export default {
  name: 'WebHomeConfig',
  components: { FloorList, Edit },
  data() {
    return {
      pageData: {
        id: 2,
        name: 'WEB主页'
      },
      showEdit: false,
      editData: '' // 编辑楼层详情数据
    }
  },
  computed: {

  },
  created() {
  },
  mounted() {
  },
  methods: {
    // 楼层编辑
    handleEdit(row) {
      if (row && row.id) {
        this.editData = row
      } else {
        this.editData = ''
      }
      this.$nextTick(() => {
        this.showEdit = true
      })
    },
    handleSubmitSuccess() {
      this.$refs.refFloor.initTableData()
    }
  }
}

</script>
<style lang='scss' scoped>

</style>
